<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateSkuPropsValsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('sku_props_vals', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('props_id')->comment('props表的外键 属性id');
            $table->integer('props_val_id')->comment('props_val表的外键 属性的值id');
            $table->integer('sku_id')->comment('sku(商品细分到某个产品)表的外键');
            $table->integer('spu_id')->comment('spu(商品)表的外键');
            $table->tinyInteger('disabled')->comment('是否删除 0-否 1-是')->default(0);
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('sku_props_vals');
    }
}
